package com.xvaca.spcms.servlet.admin.channel;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.xvaca.spcms.bean.ChannelBean;
import com.xvaca.spcms.dao.ChannelDAO;

/**
 * Servlet implementation class ChannelListServlet
 */
public class ChannelListServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		ChannelDAO dao = new ChannelDAO();
		List<ChannelBean> channels = dao.getChannelList();
		request.setAttribute("channels", channels);
		request.getRequestDispatcher("channel_list.jsp").forward(request, response);
	}

}
